<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta name="baidu-site-verification" content="uO9sXDENB9" />
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>钢链网</title>

    <link rel="stylesheet" href="/resource/css/gl_index.css">
    <link rel="stylesheet" href="/resource/css/gl_showBo.css">

    <script src="/resource/js/jquery-1.11.3.min.js"></script>
    <script src="/resource/js/gl_index.js"></script>
    <script src="/resource/js/gl_showBo.js"></script>
    <script src="/resource/js/jQuery.textSlider.js"></script>     <!-- 文字滚动 -->
    <script src="/resource/js/jquery.flexslider-min.js"></script> <!-- banner -->
    <script src="/resource/js/jquery.flexisel.js"></script>
    <script src="/resource/js/gl_pro_city.js"></script>
    <script src="/resource/js/jquery.fly.min.js"></script>
    <!--[if lte IE 9]>
    <script src="/resource/js/requestAnimationFrame.js"></script>
    <![endif]-->
    <script>
        $(function(){
            //banner 索引居中
            if($('.banner .slides li').length>1){
                var slides_w = $('.banner .slides li').length*44/2;
                var STR = "<style>.banner .flex-control-nav::after,.banner .flex-control-nav::before{width:"+slides_w+"px;}.banner .flex-control-nav::before{margin-left:-"+slides_w+"px}</style>"
                $(STR).appendTo('body');
            }
            //购物车动画
            $(document).delegate(".addcar","click",function(event){
                var offset = $("#shopping").offset();
                var img = './resource/img/logo_shop_tra.png';
                var flyer = $('<img class="u-flyer" src="'+img+'">');
                var product_id = $(this).attr('product_id');
                flyer.fly({
                    start: {
                        left: event.pageX,
                        top: event.pageY-$(document).scrollTop()
                    },
                    end: {
                        left: offset.left+10,
                        top: offset.top-$(document).scrollTop()+100,
                        width: 0,
                        height: 0
                    },
                    onEnd: function(){

                        $.ajax({
                            url: "/shop_add_cart",
                            type: "get",
                            data: "product_id="+product_id,
                            success: function (msg) {
                                $("#cart_info").html(msg);
                                if($('#cart_num span').length<1){
                                    $('#cart_num').append('<span>1</span>');
                                }else{
                                    $('#cart_num span').html(parseInt($('#cart_num span').html())+1);
                                }
                                if($('#cart_num_top span').length<1){
                                    $('#cart_num_top').append('<span>1</span>');
                                }else{
                                    $('#cart_num_top span').html(parseInt($('#cart_num_top span').html())+1);
                                }
                            }
                        });
                        this.destory();
                    }
                });
            });

            $("#info-ul").textSlider({line:1,speed:500,timer:3000});
            $('.banner-box').flexslider({	//banner轮播
                directionNav: true,
                pauseOnAction: false
            });
            $('.act-img').flexslider({	//banner轮播
                directionNav: true,
                pauseOnAction: false
            });
            $(".flexiselDemo1").flexisel({
                visibleItems: 5,
                animationSpeed: 200,
                autoPlay: true,
                autoPlaySpeed: 6000,
                pauseOnHover: true
            });
            $(".flexiselDemo3").flexisel({
                visibleItems: 5,
                animationSpeed: 1000,
                autoPlay: true,
                autoPlaySpeed: 3000,
                pauseOnHover: true
            });

            // 点击找货 判断



        });
    </script>


</head>
<body>

@include('common.shop_head')

<div class="banner">
    <div class="banner-box">
        <ul class="slides">
            @foreach($info['ads'] as $a)
                <li><a href="javascript:;"><img src="{{$a->img}}" alt=""></a></li>
            @endforeach
        </ul>
    </div>
    {{--<div class="main">--}}
        {{--<div class="search-box wow fadeInLeft animated" data-wow-delay="0.4s">--}}
            {{--<div class="box-left">--}}
                {{--<ul>--}}
                    {{--<li class="active"><a href="javascript:;">找现货</a></li>--}}
                    {{--<li><a href="javascript:;">找物流</a></li>--}}
                    {{--<li><a href="javascript:;">找资金</a></li>--}}
                {{--</ul>--}}
            {{--</div>--}}
            {{--<div class="box-right">--}}
                {{--<div class="box">--}}
                    {{--<div class="title">建材</div>--}}
                    {{--<form action="/shopping" method="post" class="form-inline">--}}
                        {{--<div class="form-group">--}}
                            {{--<label for="">地区</label>--}}
                            {{--<input type="hidden" name="address"/>--}}
                            {{--<input type="text" class="form-control" id="" name="city_name" placeholder="">--}}
                        {{--</div>--}}
                        {{--<div class="form-group">--}}
                            {{--<label for="">规格</label>--}}
                            {{--<input type="text" class="form-control" placeholder="" name="spec">--}}
                        {{--</div>--}}
                        {{--<div class="form-group">--}}
                            {{--<label for="">仓库</label>--}}
                            {{--<input type="hidden" name="storage"/>--}}
                            {{--<input type="text" class="form-control" placeholder="" name="storage_name">--}}
                        {{--</div>--}}
                        {{--<div class="form-group">--}}
                            {{--<label for="">品名</label>--}}
                            {{--<input type="hidden" name="brand"/>--}}
                            {{--<input type="text" class="form-control" placeholder="" name="brand_name">--}}
                        {{--</div>--}}
                        {{--<div class="form-group">--}}
                            {{--<label for="">材质</label>--}}
                            {{--<input type="hidden" name="material"/>--}}
                            {{--<input type="text" class="form-control" placeholder="" name="material_name">--}}
                        {{--</div>--}}
                        {{--<div class="form-group">--}}
                            {{--<label for="">钢厂</label>--}}
                            {{--<input type="hidden" name="factory"/>--}}
                            {{--<input type="text" class="form-control" placeholder="" name="factory_name">--}}
                        {{--</div>--}}
                        {{--<div class="clear"></div>--}}
                        {{--<div class="see-button clear">--}}
                            {{--<input type="submit" class="form-control btn-search" value="搜索">--}}
                        {{--</div>--}}
                    {{--</form>--}}
                {{--</div>--}}
                {{--<div class="box">--}}
                    {{--<a href="javascript:;"><img src="/resource/img/index_sear_no.jpg" alt="" style="margin-top:40px"></a>--}}
                {{--</div>--}}
                {{--<div class="box">--}}
                    {{--<a href="javascript:;"><img src="/resource/img/index_sear_mon.jpg" alt=""></a>--}}
                {{--</div>--}}
            {{--</div>--}}
        {{--</div>--}}
    {{--</div>--}}
</div>
<div class="cont-bg resources main">
    <div class="wrap-res">
        <div class="title">优质资源
            <a href="/shopping" class="right">更多<i></i></a>
        </div>
        <div class="resour-box wow fadeInLeft animated" data-wow-delay="0.4s">
            <div class="logo-box">
                <ul class="flexiselDemo1">
                    <li><a href="javascript:;"><img src="/resource/img/a.png" alt=""></a></li>
                    <li><a href="javascript:;"><img src="/resource/img/b.png" alt=""></a></li>
                    <li><a href="javascript:;"><img src="/resource/img/c.png" alt=""></a></li>
                    <li><a href="javascript:;"><img src="/resource/img/d.png" alt=""></a></li>
                    <li><a href="javascript:;"><img src="/resource/img/f.png" alt=""></a></li>
                    <li><a href="javascript:;"><img src="/resource/img/g.png" alt=""></a></li>
                </ul>
            </div>
            <div class="res-info">
                @foreach($info['products_index'] as $v)
                    <div class="info-box">
                        <a href="/shopping?product_id={{$v->product_id}}">
                            <div class="left">
                                <span>{{$v->product_brand}}</span><span>{{$v->product_material}}</span><br/><span>{{$v->factory}}</span><span>{{$v->product_spec}}</span>
                            </div>
                            <div class="money right">
                                ￥{{$v->product_price}}
                            </div>
                        </a>
                    </div>
                @endforeach
            </div>
        </div>
    </div>
    <div class="wrap-help wow fadeInRight animated" data-wow-delay="0.4s">
        <div class="title">帮我找货</div>
        <form action="" class="form-inline">
            <div class="form-group">
                <div class="form-control form-mar form-category">
                    <div class="category-ame">
                        <div class="category-title">
                            请选择品类
                        </div>
                        <i></i>
                        <input type="hidden" name="breedId" id="breedId" value="">
                        <input type="hidden" name="brand" id="brand" value="">
                    </div>
                    <div class="category-cont">
                        <ul>
                            @foreach($select_brand as $v)
                                <li rel="{{$v->brand_id}}">{{$v->brand_name}}</li>
                            @endforeach
                        </ul>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="form-control form-city">
                    <div class="area-ame">
                        <div class="area-title">
                            请选择城市
                        </div>
                        <i></i>
                        <input type="hidden" name="provinceId" id="provinceId" value="">
                        <input type="hidden" name="cityId" id="cityId" value="">
                    </div>
                    <div class="city-content">
                        <div class="select-tab">
                            <a href="javascript:;" class="active"  data-to="province_list">省份</a>
                            <a href="javascript:;" data-to="city_list">城市</a>
                        </div>
                        <div class="area-list province_list"></div>
                        <div class="area-list city_list"></div>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <textarea name="description" id="description"  class="form-control">请尽可能详细写下您所需钢材的需求，方便我们为您更快找到合适货源！</textarea>
            </div>
            <div class="form-group">
                <input type="text" name="mobile" id="mobile" class="form-control form-tel" placeholder="联系电话"/>
            </div>
            <div class="form-group">
                @if(!session_get(UserEnum::USER_INFO_SESSION_KEY))
                <input type="button" onclick="login()" class="form-control form-btn" value="找货"/>
                    @else
                    <input type="button" onclick="customize()" class="form-control form-btn" value="找货"/>
                    @endif
            </div>

        </form>
    </div>
</div>
<div class="cont-bg we-service main">
    <div class="ser-box">
        <div class="left wow fadeInLeft animated" data-wow-delay="0.4s">
            <div class="title">新品推荐
                <a href="/shopping" class="right">更多<i></i></a>
            </div>
            <table class="table">
                <thead>
                <tr>
                    <th width="150px">品名</th>
                    <th width="110px">钢厂</th>
                    <th width="100px">材质</th>
                    <th width="100px">规格</th>
                    <th width="100px">仓库</th>
                    <th width="100px">件重（吨）</th>
                    <th width="110px">单价(元/吨)</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                @foreach($info['products_new'] as $v)
                    <tr>
                        <td><div>{{$v->product_brand}}</div></td>
                        <td><div>{{$v->factory}}</div></td>
                        <td><div>{{$v->product_material}}</div></td>
                        <td><div>{{$v->product_spec}}</div></td>
                        <td><div>{{$v->storage}}({{$v->storage_city}})</div></td>
                        <td><div>{{$v->piece_weight}}</div></td>
                        <td><div><span>￥{{$v->product_price}}</span></div></td>
                        <td>
                            @if(session_get(UserEnum::USER_INFO_USER_ID))
                            <a href="javascript:;" class="addcar" product_id="{{$v->product_id}}">购买</a>
                                @else
                                <a href="javascript:;" onclick='login()'>购买</a>
                                @endif
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>
        <div class="right wow bounceIn animated" data-wow-delay="0.4s">
            <div class="title">
                成交动态
            </div>
            <div class="info">
                <div class="info-til">
                    <div class="left">商品</div>
                    <div class="left">时间</div>
                    <div class="right">状态</div>
                </div>
                <div class="info-ul" id="info-ul">
                    <ul>
                        <li>
                            <div class="left"><span>三级螺纹钢</span>HRB400 16*9</div>
                            <div class="left">2016-8-18  12:30</div>
                            <div class="right">成交</div>
                        </li>
                        <li>
                            <div class="left"><span>三级抗震螺纹钢</span>HRB400E 25*12</div>
                            <div class="left">2016-8-18  12:30</div>
                            <div class="right">成交</div>
                        </li>
                        <li>
                            <div class="left"><span>三级螺纹钢</span>HRB400 14*9</div>
                            <div class="left">2016-8-18  12:30</div>
                            <div class="right">成交</div>
                        </li>
                        <li>
                            <div class="left"><span>三级螺纹钢</span>HRB400 14*9</div>
                            <div class="left">2016-8-18  12:30</div>
                            <div class="right">成交</div>
                        </li>
                        <li>
                            <div class="left"><span>三级抗震螺纹钢</span>HRB400E 20*12</div>
                            <div class="left">2016-8-18  12:30</div>
                            <div class="right">成交</div>
                        </li>
                        <li>
                            <div class="left"><span>高线</span></br>HPB300 8</div>
                            <div class="left">2016-8-18  12:30</div>
                            <div class="right">成交</div>
                        </li>
                        <li>
                            <div class="left"><span>三级抗震螺纹钢</span>HRB400E 16*12</div>
                            <div class="left">2016-8-18  12:30</div>
                            <div class="right">成交</div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="cont-bg information main">
    <div class="title">行情快讯
     {{-- <a href="javascript:;" class="right">更多<i></i></a>--}}
    </div>
    <div class="act-box">
        <div class="left act-img">
            <ul class="slides">
                @foreach($information['index_information'] as $v)
                    <li><a href="/information_details?id={{$v->zx_id}}">
                            <img src="{{$v->thumb_img1}}" alt="">
                            <span>{{mb_substr($v->title,0,14,'utf-8')}}</span>
                        </a></li>
                @endforeach
            </ul>
        </div>
        <div class="act-text left">
            <ul>
                @foreach($information['information'] as $v)
                    <li>
                        <a href="/information_details?id={{$v->zx_id}}"><?php if(strlen($v->title)/3>20){echo mb_substr($v->title,0,20,'utf-8')."...";}else{echo $v->title;};?><span>{{date('Y-m-d',$v->created)}}</span></a>
                    </li>
                @endforeach
            </ul>
        </div>
    </div>
</div>
<div class="cont-bg partner main">
    <div class="title">合作伙伴</div>
    <div class="scroll-slider par-box">
        <ul class="flexiselDemo3">
            {{--<li><a href="javascript:;"><img src="/resource/img/logo_1.png"></a></li>--}}
            <li><a href="javascript:;"><img src="/resource/img/logo_2.png"></a></li>
            <li><a href="javascript:;"><img src="/resource/img/logo_3.png"></a></li>
            <li><a href="javascript:;"><img src="/resource/img/logo_4.png"></a></li>
            <li><a href="javascript:;"><img src="/resource/img/logo_5.png"></a></li>
            <li><a href="javascript:;"><img src="/resource/img/logo_6.png"></a></li>
            <li><a href="javascript:;"><img src="/resource/img/logo_7.png"></a></li>
            <li><a href="javascript:;"><img src="/resource/img/logo_8.png"></a></li>
            <li><a href="javascript:;"><img src="/resource/img/logo_9.png"></a></li>
            <li><a href="javascript:;"><img src="/resource/img/logo_10.png"></a></li>
        </ul>
    </div>
</div>
<div class="gl-info">
    <div class="main">
        <div class="info-box">
            <div class="cont cont1">
                <i></i>
                <div class="right"><span>品质保障</span>品质护航 &#160; 购物无忧</div>
            </div>
            <div class="cont cont2">
                <i></i>
                <div class="right"><span>物流服务</span>急速响应 &#160; 省心贴心</div>
            </div>
            <div class="cont cont3">
                <i></i>
                <div class="right"><span>金融服务</span>多样融资 &#160; 方便快捷</div>
            </div>
            <div class="cont cont4">
                <i></i>
                <div class="right"><span>客户服务</span>准确高效 &#160; 完善保障</div>
            </div>
        </div>
    </div>
</div>
@include('common.shop_foot')
</body>
</html>
<script>
    function customize(){
        var  description = $('#description').val();
        var  mobile      = $('#mobile').val();
        var  brand       = $('#breedId').val();
        var  province    = $('#provinceId').val();
        var  city        = $('#cityId').val();
        if(description && description!="请尽可能详细写下您所需钢材的需求，方便我们为您更快找到合适货源！"){
            if(city!=""){
                if(brand){
                    if((/^1[34578]\d{9}$/.test(mobile))){
                        $.ajax({
                            url: "/publish_customize",
                            type: "POST",
                            data: 'description=' + description + "&mobile=" + mobile+"&brand="+brand+ "&province=" + province+"&city="+city,
                            async:false,
                            success: function (msg) {
                                if (msg) {
                                    Showbo.Msg.alert('<img src="/resource/img/gl_show_succ.png"><div style="font-size:24px;">提交成功</div><div style="width:240px;margin:15px auto 30px auto;font-size:14px;">我们会尽快为您找到匹配的货源，稍后工作人员将会与您联系</div>');
                                };
                            }
                        });
                    }else{
                        Showbo.Msg.alert('<img src="/resource/img/gl_show_err.png" style="margin-top:20px;">电话有误  <br/><br/>');
                    }
                }else{
                    Showbo.Msg.alert('<img src="/resource/img/gl_show_err.png" style="margin-top:20px;">请选择品名  <br/><br/>');
                }
            }else{
                Showbo.Msg.alert('<img src="/resource/img/gl_show_err.png" style="margin-top:20px;">请选城市  <br/><br/>');
            }
        }else{
            Showbo.Msg.alert('<img src="/resource/img/gl_show_err.png" style="margin-top:20px;">请填写采购需求 <br/><br/>');
        }
    };
    // 点击找货 登录
    function login(){
        $('.popup').show();
        $('.popup-login').show();
    };
</script>